﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace NetworkSimulator
{
    public class Config
    {
        private string topologyFilePath;

        public string TopologyFilePath
        {
            get { return topologyFilePath; }
        }

        private string requestFilePath;

        public string RequestFilePath
        {
            get { return requestFilePath; }
        }

        private int periodTime;

        public int PeriodTime
        {
            get { return periodTime; }
        }

        private string routingAlgorithm;

        public string RoutingAlgorithm
        {
            get { return routingAlgorithm; }
        }

        public Config()
        {
            topologyFilePath = ConfigurationManager.AppSettings["topologyFilePath"].ToString();
            requestFilePath = ConfigurationManager.AppSettings["requestFilePath"].ToString();
            periodTime = int.Parse(ConfigurationManager.AppSettings["periodTime"].ToString());
            routingAlgorithm = ConfigurationManager.AppSettings["routingAlgorithm"].ToString();
        }

        private static Config singleTonObject;

        public static Config instance()
        {
            if (singleTonObject == null)
                singleTonObject = new Config();
            return singleTonObject;
        }
    }
}
